<template>
	<view class="container">
		<view class="logo-box">
            <u-image width="160rpx" height="160rpx" :src="getServerStatic('/static/images/a23.png')" v-if=" systemStore.miniAppLogo=='' "></u-image>
            <u-image width="200rpx" height="180rpx" :src="checkAndFixUrl(systemStore.miniAppLogo)" v-else></u-image>
		</view>
		<view class="title">{{  systemStore.miniAppName ?? '综合门诊' }}</view>
		<view class="version">当前版本（v.8.15.7）</view>

		<!-- 协议 -->
		<view class="cell-group">
			<view class="cell-item" @tap="goAgreement(1)">
				<view class="left">
					<u-image width="84rpx" height="84rpx" :src="getServerStatic('/static/images/a14.png')"></u-image>
					<view>用户协议</view>
				</view>
				<u-icon name="arrow-right" color="#91959E" size="18"></u-icon>
			</view>
			<view class="cell-item" @tap="goAgreement(2)">
				<view class="left">
					<u-image width="84rpx" height="84rpx" :src="getServerStatic('/static/images/a15.png')"></u-image>
					<view>隐私政策</view>
				</view>
				<u-icon name="arrow-right" color="#91959E" size="18"></u-icon>
			</view>
		</view>

		<view class="content">
            {{ content }}
		</view>
	</view>
</template>

<script setup>
    import {ref, reactive, readonly} from 'vue'
    import {onLoad, onShow, onReady} from '@dcloudio/uni-app'
    import {getAboutUs} from "@/api/cms";
    import {checkAndFixUrl, getServerStatic} from "@/utils/tool";
    import { useSystemStore } from '@/store';
    const systemStore = useSystemStore()

    const content = ref('')

    onLoad(() => {

        handleGetAboutUs()
    })

    const handleGetAboutUs = async () => {
        const {code, data, message} = await getAboutUs()
        content.value = data.value
        console.log(data)
    }

    // 用户协议和隐私政策 1用户 2隐私
	const goAgreement = (e) => {
		uni.navigateTo({
			url: `/mine/agreement/agreement?status=${e}`
		})
	}
</script>

<style lang="scss" scoped>
	.container {
		display: flex;
		flex-direction: column;
		align-items: center;
		padding: 60rpx 37rpx;
		.title {
			margin-top: 38rpx;
			font-size: 40rpx;
			color: #516DDB;
		}
		.version {
			margin-top: 20rpx;
			font-size: 26rpx;
			color: #AAAAAA;
		}
		.cell-group {
			margin-top: 40rpx;
			width: 100%;
			.cell-item {
				@include between(100%, 130rpx);
				background: #FFFFFF;
				border-radius: 30rpx;
				padding: 0 30rpx;
				margin-bottom: 30rpx;

				.left {
					@include start();

					&>view {
						font-size: 32rpx;
						color: #606672;
						margin-left: 32rpx;
					}
				}
			}
		}
		.content {
			margin-top: 20rpx;
			color: #131313;
			line-height: 50rpx;
		}
	}
</style>
